package com.apimarket.util.kong;

import com.apimarket.entity.kong.Consumer;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;

/**
 * 除了必要的增删改查，此接口还提供消费者与插件绑定信息的API
 * 泛型T指明实现类需要绑定插件的凭据实体类
 *
 * @author yyc
 */
public interface KongConsumerOperation<T> {
    Consumer addConsumer(Consumer consumer);

    Consumer getConsumer(Consumer consumer);

    List<Consumer> listConsumers();

    Consumer updateConsumer(Consumer consumer);

    void deleteConsumer(String nameOrId);

    T bindPlugin(String nameOrId, Object... args) throws IOException, URISyntaxException;

    List<T> listAllBindPluginDetail() throws IOException, URISyntaxException;

    List<T> listBindPluginDetailViaConsumer(String nameOrId) throws IOException, URISyntaxException;
}
